package cn.skcks.service;

import cn.skcks.dao.BookMapper;
import cn.skcks.pojo.Books;
import org.springframework.stereotype.Service;

import java.util.List;

// BookService 实现类
public class BookServiceImpl implements BookService {
	// 组合 dao, 通过 service 调用 dao 层
	private BookMapper mapper;

	public void setMapper(BookMapper mapper) {
		this.mapper = mapper;
	}

	public int addBook(Books books) {
		return mapper.addBook(books);
	}

	public int delBook(int bookID) {
		return mapper.delBook(bookID);
	}

	public int modBook(Books books) {
		return mapper.modBook(books);
	}

	public Books getBook(int bookID) {
		return mapper.getBook(bookID);
	}

	public List<Books> allBook() {
		return mapper.allBook();
	}
}